
/**
 * Article model
 *
 * @author glory.xu
 */

import { Application } from 'egg';

export default function(app: Application) {
  const { STRING, INTEGER } = app.Sequelize;

  const Article = app.model.define('article', {
    id: {
      type: INTEGER,
      primaryKey: true,
      autoIncrement: true,
    },
    title: STRING,
    discribe: STRING,
    content: STRING,
    imgUrl: STRING,
    categoryId: INTEGER,

  }, {

    freezeTableName: true,
    tableName: 'article',
  });

  return class extends Article {};
}
